package com.mspbots.cw.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.TopicExchange;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * @author sean.wang
 * @date Created by 2020/02/27
 */
@Configuration
public class ReportsRabbitConfiguration {

    public static final String EXCHANGE_NAME = "msp.reports";
    public static final String NTC_CW_TICKET_QUEUE = "report.message.NTC_CW_Ticket";


    @Bean
    public TopicExchange topicExchange() {
        return new TopicExchange(EXCHANGE_NAME);
    }

    @Bean
    public Queue ntc_cw_Queue() {
        return new Queue(NTC_CW_TICKET_QUEUE);
    }

    @Bean
    public Binding bindingNtCCWQueue() {
        return BindingBuilder.bind(ntc_cw_Queue()).to(topicExchange()).with(NTC_CW_TICKET_QUEUE);
    }

}
